import request from '../untils/request'

//首页数据
export let getIndexNav=()=>{
    return request.post('/api/service/home',{mid:0,phoneTerminal:2});
}
//轮播图数据
export let getIndexLun=()=>{
    return request.post('/api/service/carouselList',{mid:0,rcid:0})
}
// 首页排名数据
export let getIndexSmall = ()=>{
    return request.post('/api/service/rankPage', {mid: 0, phoneTerminal: 2});
}
//首页 生活严选排名
export let getIndexNew=()=>{
    return request.post('/api/service/articlePage',{mid:0,orderBy:1,filter:'',rankCategoryld:0,pageNo:1})
}

//分类 左边列表
export let getLeftList=()=>{
    return request.post('/api/service/rankCategoryList',{mid:0})
}
//消息列表接口
export let getRightList=(pageNo:number)=>{
    return request.post('/api/service/messagePage',{mid:0,pageNo})
}

//我的接口
export let getUserInfo=()=>{
    return request.post('/api/service/info', { mid: 'fa291cbd52aa40d2b47ba96c8ec59c99' })
}

// 文件上传接口
// export let fileUpload = (form: FormData) => {
//     return request.post('/api/service/fileUpload', form);
// }

// 更新用户信息接口
export let changeInfo = (info:string) => {
    return request.post('/api/service/changeInfo', info)
}

// 发送手机验证码
export let getAuthCode = (mobile: string) => {
    return request.post("/api/service/getAuthCode", {
        uid: "fa291cbd52aa40d2b47ba96c8ec59c99",
        type: "3",
        mobile
    })
}

   // export let changeMobile = (info: IMobileInfo)=>{
//     return request.post('/api/service/changeMobile', info)
// }

// 退出登录
export let logout = (mid = 'fa291cbd52aa40d2b47ba96c8ec59c99')=>{
    return request.post('/api/service/logout', { mid: 'fa291cbd52aa40d2b47ba96c8ec59c99' })
}

// 热门搜索列表
export let getHotList = ()=>{
    return request.post('/api/service/hotList', {mid: 0});
}

// 搜索接口
export let getSearchList = (keyword: string)=>{
    return request.post('/api/service/search', {mid: 0, keyword});
}

// 关键词提示
export let getSearchTips = (keyword: string)=>{
    return request.post('/api/service/searchTips', {keyword});
}


const mid = 'fa291cbd52aa40d2b47ba96c8ec59c99';
// 文章详情
export let getArticleDetail = (articleId: string)=>{
    return request.post('/api/service/articleDetail', {mid, articleId});
}

// 文章评论
export let getArticleComment = (articleId: string, pageNo=1)=>{
    return request.post('/api/service/articleCommentPage', {mid, articleId, pageNo});
}
//排行详情
export const Detail = (rankId:string) => {
    return request.post("/api/service/rankDetail", { "mid": "0",
  "drops": "",rankId})
  }
  //详情页每一项
export const getRankDropList = (str) => {
    return request.post("/api/service/rankDropList", { "mid": "0",
  rankId:str})
  }